package android_design_mode.chapter08_state;

/**
 * 相当于Context
 */
public class TVController implements IPowerController, ITVState {

    private ITVState ITVState;

    public void setITVState(ITVState mITVState) {
        this.ITVState = mITVState;
    }

    @Override
    public void powerOn() {
        setITVState(new PowerOnState());
        System.out.println("State On");

    }

    @Override
    public void powerOff() {
        setITVState(new PowerOffState());
        System.out.println("State Off");
    }


    @Override
    public void nextChannel() {
        ITVState.nextChannel();
    }

    @Override
    public void prevChannel() {
        ITVState.prevChannel();
    }

    @Override
    public void turnUp() {
        ITVState.turnUp();
    }

    @Override
    public void turnDown() {
        ITVState.turnDown();
    }
}
